<?php

namespace App\Http\Requests\Admin\Tenant;

use App\Models\Tenant;
use Illuminate\Foundation\Http\FormRequest;

class UpdateTenantStatusRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user('admin') !== null;
    }

    public function rules(): array
    {
        return [
            'status' => 'required|in:' . implode(',', [
                Tenant::STATUS_ACTIVE,
                Tenant::STATUS_INACTIVE,
            ]),
        ];
    }
}
